package com.pro.controller;

import com.pro.pojo.JsDeptAuthority;
import com.pro.pojo.JsonData;
import com.pro.service.JsDeptAuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 祖铭泽
 * @Date 2022/2/22/0022
 * @description 部门权限 控制层
 */
@Controller
@RequestMapping(value = "/jsDeptAuthority")
public class JsDeptAuthorityController {
    @Autowired
    private JsDeptAuthorityService jsDeptAuthorityService;

    /**
     * @Author 祖铭泽
     * @Date 2022/2/22/0022
     * @description 根据部门id查询多个权限
     */
    @RequestMapping(value = "/getUserSelectDeptAuthority")
    @ResponseBody
    public JsonData getUserSelectDeptAuthority(Integer deptId){
        return jsDeptAuthorityService.getDeptAuthoritys(deptId);
    }
    /**
     * @Author 祖铭泽
     * @Date 2022/2/23/0022
     * @description 为部门添加多个权限
     */
    @RequestMapping(value = "/addDeptAuthoritys")
    @ResponseBody
    public JsonData addDeptAuthoritys(JsDeptAuthority jsDeptAuthority) {
        return jsDeptAuthorityService.addDeptAuthoritys(jsDeptAuthority);
    }

}
